import random
# 石头1/剪刀2/布3
y = int(input('请出拳(石头1/剪刀2/布3):'))
random_x=random.randint(1,3)
print(f'电脑出的是{random_x}')
if random_x==1 and y==1:
    print('平局')
elif random_x==2 and y==2:
    print('平局')
elif random_x==3 and y==3:
    print('平局')
elif random_x==1 and y==2:
    print('电脑赢了')
elif random_x==2 and y==3:
    print('电脑赢了')
elif random_x == 3 and y == 1:
    print('电脑赢了')
elif random_x==1 and y==3:
    print('你赢了')
elif random_x==2 and y==1:
    print('你赢了')
elif random_x==3 and y==2:
    print('你赢了')


# 简单写法
print('----------------------------------------')
print('第二次比赛')
y = int(input('请出拳(石头1/剪刀2/布3):'))
random_x=random.randint(1,3)
print(f'电脑输入的是{random_x}')
if (random_x==1 and y==2) or (random_x==2 and y==3) or (random_x==3 and y==1):
    print('电脑胜利，老弟你还得练')
elif random_x==y:
    print('平局，没输没赢')
else:
    print('你无敌了，孩子！')

